#ifndef VIEWLOGSDIALOG_H
#define VIEWLOGSDIALOG_H

#include <QDialog>

namespace Ui {
class ViewLogsDialog;
}

class ViewLogsDialog : public QDialog
{
    Q_OBJECT

public:
    explicit ViewLogsDialog(QWidget *parent = nullptr);
    ~ViewLogsDialog();

    void show(const QString &logdir);

private:
    void initWidget();
    void initTableHeader();
    void fillTableData(const QStringList &logfiles);
    void setSelectedRowSign(int row, bool show);

protected:
    void paintEvent(QPaintEvent *);
    void showEvent(QShowEvent *);

private slots:
    void on_tableWidget_cellClicked(int row, int column);
    void on_btnOpenSelected_clicked();
    void on_btnExportSelected_clicked();
    void on_btnExportAll_clicked();
    void on_btnClose_clicked();

private:
    Ui::ViewLogsDialog *ui;
    QString m_selectedLogfile;
    QString m_logdir;
};

#endif // VIEWLOGSDIALOG_H
